// 地图
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const ObjectId = Schema.Types.ObjectId;

const MapSchema = new Schema({
    mid: { // 地图id
        type: Number,
        required: true
    },
    name: {
        type: String,
        required: true
    },
    icon: {
        type: String
    },
    info: {
        type: String,
        default: "地图信息"
    },
    type: {
        type: Number,
        default: 0
    },
    npcs: [{
        type: ObjectId,
        ref: "Npc"
    }],
    users: [{
        type: ObjectId,
        ref: "User"
    }],
});

module.exports = Maps = mongoose.model("maps", MapSchema);